// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: wsfuyibing <682805@qq.com>
// Date: 2024-12-05

package errs

import "gitee.com/go-libs/runtime"

var (
	ErrBucketOutOfMemory = runtime.NewError(10000, "bucket out of memory")

	ErrNotificationBodyNotJsonFormat   = runtime.NewError(10001, "notification body not json format")
	ErrNotificationBodyNotUnmarshalled = runtime.NewError(10002, "can not unmarshal notification body")

	ErrSchedulerHasExist = runtime.NewError(10011, "scheduler has exist")
	ErrSchedulerNotBuilt = runtime.NewError(10012, "scheduler built failed")
	ErrSchedulerNotExist = runtime.NewError(10013, "scheduler not exist")

	ErrServletHasExist = runtime.NewError(10021, "servlet has exist")
	ErrServletNotBuilt = runtime.NewError(10022, "servlet built failed")
	ErrServletNotExist = runtime.NewError(10023, "servlet not exist")

	ErrTransformHasExist = runtime.NewError(10031, "transition has exist")
	ErrTransformNotBuilt = runtime.NewError(10032, "servlet built failed")
	ErrTransformNotExist = runtime.NewError(10033, "servlet not exist")
)

var (
	ErrFilterFormatNotSpecified          = runtime.NewError(21, "format for filter not specified")
	ErrFilterExpressionNotSpecified      = runtime.NewError(22, "expression for filter not specified")
	ErrFilterNoAnyCondition              = runtime.NewError(23, "no any valid condition for filter")
	ErrFilterFieldExpressionNotSpecified = runtime.NewError(24, "expression for field of the filter not specified")
	ErrFilterFieldExpressionNotValid     = runtime.NewError(25, "expression for field of the filter not valid")
	ErrFilterUnsupportedOperator         = runtime.NewError(26, "unsupported field operator of the filter")
	ErrFilterInvalidNumberValue          = runtime.NewError(27, "invalid number value for the field")
	ErrFilterBuildExpectValueFailed      = runtime.NewError(28, "fail to build filter field expect value")

	ErrFilterInvalidBodyForJson = runtime.NewError(31, "invalid json body for filter match")
	ErrFilterInvalidBodyForXml  = runtime.NewError(32, "invalid xml body for filter match")
	ErrFilterInvalidBodyType    = runtime.NewError(33, "invalid body type for filter match")
)
